//
//  GCD(extension).swift
//  SwiftCommon
//
//  Created by 董振山 on 2018/5/18.
//  Copyright © 2018年 董振山. All rights reserved.
//

import Foundation

///延迟执行
func delayExecute(_ delay:Double, blok:@escaping () -> Void) {
    DispatchQueue.main.asyncAfter(
        deadline: DispatchTime.now() + Double(Int64(delay * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: blok)
}
/// 异步执行
func asyncExecute(block:@escaping () -> Void){
    DispatchQueue.global().async {
        block()
    }
}




